<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="utf-8" />
    <title></title>
    <!-- import Vue before Element -->
<!--    <script src="https://unpkg.com/vue/dist/vue.js"></script>-->

    <script src="../static/js/vue.js" th:src="@{/js/vue.js}"></script>
    <script src="../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<!--    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
    <link rel="stylesheet" href="../static/js/element-ui/index.css"  th:href="@{/js/element-ui/index.css}">
    <style lang="scss" scoped>
        .el-timeline-item__tail {
            position: absolute;
            left: 4px;
            height: 100%;
            /*border-left: 2px solid #1ab394;*/
        }
        .el-textarea__inner{
            height: 228px;
        }
        .wrap {
            table-layout: fixed;
            word-wrap: break-word;
            word-break: normal;
            overflow: hidden;
        }
        html,body {
            height: 100%;
        }
        #app {
            height: 100%;
        }

        [v-cloak] {
            display: none;
        }

    </style>
    <th:block th:include="include :: select2-css" />
</head>


<body>
<div id="app" style="display: none;" :style="{display: 'block'}">

    <h2 th:text="${ problem + '的进度' }" style="margin-left: 40px;" v-if="titleShow"/>
<!--    <h2 th:text="${ '无效件' }" style="margin-left: 40px;color: #eee;" v-if="!titleShow"/>-->
    <h2 style="margin: 300px 42%;color: white;font-size: 80px;width: 300px;" v-if="!titleShow" >无效件</h2>

    <div class="block">
        <el-timeline>
            <el-timeline-item placement="top"
                              v-for="(activity, index) in activities"
                              :key="index"
                              :icon="activity.icon"
                              :type="activity.type"
                              :color="activity.color"
                              :size="activity.size"
                              v-if="activity.show"
                              :timestamp="activity.progress">
                <el-card style="width: 60%">
                    <el-tooltip :content="activity.tooltipContent1" placement="top" :disabled="activity.tooltipShow">
                        <el-tag :type="activity.tagType" style="float: right;" v-if="activity.tagShow">{{ activity.complete }}</el-tag>
                    </el-tooltip>
                    <el-tooltip :content="activity.tooltipContent2" placement="top">
                        <el-tag :type="activity.tagType1" style="float: right; margin-right: 10px;" v-if="activity.tagShow1">{{ activity.complete1 }}</el-tag>
                    </el-tooltip>
                    <el-tag :type="activity.tagType2" style="float: right; margin-right: 10px;" v-if="activity.tagShow2">{{ activity.complete2 }}</el-tag>

                    <h3 v-text="activity.title" style="margin-top: 5px;margin-bottom: -20px;"></h3>
                    <hr style="width: 104%; margin-top: 40px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec; margin-left: -20px;"/>

                    <div style="margin-top: 40px;" v-if="!activity.forShow">
                        <el-tag :type="activity.tagType4" style="float: right;" v-if="activity.tagShow4">{{ activity.complete4 }}</el-tag>
                        <h4 v-text="activity.content" class="wrap"></h4>
                        <p v-text="activity.responsibilityUnit" style="float: left; display: inline;"></p>
                        <p v-text="activity.time" style="float: right; display: inline;"></p>
                        <hr v-if="activity.lineShow" style="width: 100%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec;"/>

                        <h4 v-text="activity.forcedSubmitContent" style="float: left; display: inline;color: red;"></h4>
<!--                        <el-tag type="danger" style="float: right; margin-right: 10px;" v-if="activity.forcedSubmitTagShow">{{ activity.forcedSubmitContent }}</el-tag>-->
<!--                        <br>-->
                        <p v-text="activity.forcedSubmitTime" style="float: right;"></p>

                        <el-button :plain="true" @click="backToThe(activity.transferNumber)" style="float: right;margin-bottom: 15px;" v-if="activity.backButtonShow" >{{ activity.buttonContent1 }}</el-button>
                        <el-button :plain="true" @click="complete(activity.completeNum)" style="float: right;margin: 0 15px 15px 0;" v-if="activity.completeButtonShow" >完结</el-button>

                        <el-button :plain="true" @click="cuiBan(activity.transferNumber)" style="float: right;margin-bottom: 15px;" v-if="activity.buttonShow5 && !activity.forShow" >催办</el-button>
                        <el-button :plain="true" @click="forcedSubmit(activity.forcedSubmitOrder)" style="float: right;margin: 0 15px 15px 0;" v-if="activity.buttonShow6 && !activity.forShow" >强制提交</el-button>
<!--                        <hr v-if="activity.lineShow" style="width: 104%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec; margin-left: -20px;"/>-->
                    </div>

                    <div v-for="item in activity.replys" :key="item.id" style="margin-top: 40px;margin-bottom: 40px;" v-if="activity.forShow">
                        <el-tag :type="item.tagType1" style="float: right;" >{{ item.complete1 }}</el-tag>
<!--                        <el-tag type="success" style="float: right;margin-top: -7px;">已反馈</el-tag>-->

                        <h4 class="wrap">{{ item.departmentName }}的{{ item.sysEmployeeName }}的处理结果: {{ item.reply }}</h4>
                        <p style="float: left; display: inline;" v-if="item.responsibilityUnitShow">责任单位：{{ item.departmentName }}</p>
                        <p v-text="item.replyTime" style="float: right; display: inline;"></p>
<!--                        <hr v-if="activity.lineShow" style="width: 100%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec;"/>-->
                        <hr style="width: 100%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec;" v-if="item.lineShow1"/>


                        <el-button :plain="true" @click="backToThe(item.id, activity.transferNumber)" style="float: right;margin-bottom: 15px;" v-if="item.buttonShow" >{{ activity.buttonContent1 }}</el-button>
                        <el-button :plain="true" @click="complete(item.id, activity.transferNumber)" style="float: right;margin: 0 15px 15px 0;" v-if="item.buttonShow" >完结</el-button>




                        <h3 style="margin-bottom: 10px;float: left; display: inline;" v-if="item.resultShow">结果核实</h3>
                        <el-tag :type="item.tagType" style="float: right;margin-top: 10px;" v-if="item.resultShow" >{{ item.complete }}</el-tag>
<!--                        <p v-text="item.responsibilityUnit1" style="margin-top: 90px;margin-bottom: -35px;" v-if="item.resultShow">责任单位：事务服务中心</p>-->
                        <p  style="margin-top: 90px;margin-bottom: -35px;" v-if="item.resultShow">责任单位：事务服务中心</p>
                        <p v-text="item.operationTime" style="float: right; display: inline;"></p>

                        <hr v-if="item.lineShow" style="width: 104%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec; margin-left: -20px;"/>
                    </div>

<!--                    <hr style="width: 104%; margin-top: 40px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec; margin-left: -20px;"/>-->
<!--                    <el-button :plain="true" @click="forcedSubmit(activity.forcedSubmitOrder)" style="float: right;margin: 0 15px 15px 0;" v-if="activity.buttonShow6" >强制提交</el-button>-->


                    <el-button :plain="true" @click="confirmAccess()" style="float: right;margin-bottom: 15px;" v-if="activity.buttonShow" >{{ activity.buttonContent }}</el-button>
                    <el-button :plain="true" @click="invalid()" style="float: right;margin: 0 15px 15px 0;" v-if="activity.invalidButtonShow" >设为无效件</el-button>
                    <el-button :plain="true"  style="float: right;margin: 0 0 15px 0;" v-if="activity.buttonShow1" @click="showAngLoading()">移交</el-button>
                    <el-button :plain="true"  style="float: right;margin: 0 0 15px 0;" v-if="activity.buttonShow2" @click="showAngLoading2()">移交校领导</el-button>
                    <el-button :plain="true" @click="theEnd" style="float: right;margin-bottom: 15px;" v-if="activity.buttonShow3" >完成</el-button>
                    <el-button :plain="true" @click="toChat" style="float: right;margin: 0 15px 15px 0;" v-if="activity.buttonShow4" >答复提交人</el-button>

                    <hr v-if="activity.otherShow" style="width: 104%; margin-top: 60px; margin-bottom: 20px;border: 0;border-bottom: 1px solid #e7eaec; margin-left: -20px;"/>
                    <div style="display: flex; flex-wrap: wrap; justify-content: space-between" v-if="activity.otherShow">
                        <el-button :plain="true" @click="forcedSubmit(activity.forcedSubmitOrder)" v-if="activity.otherShow" >强制提交</el-button>
                        <el-button :plain="true" @click="cuiBan(activity.transferNumber)"  v-if="activity.otherShow" >催办</el-button>
                    </div>



<!--                    <h4 v-text="activity.forcedSubmitContent" style="float: left; display: inline;color: red;"></h4>-->
<!--                    <p v-text="activity.forcedSubmitTime" style="float: right;"></p>-->


<!--                    <i class="el-icon-check" style="color: #00a65a; float: right;margin: 0 15px 15px 0;"></i>-->


                    <h3 v-text="activity.title1" style="margin-bottom: 10px;float: left; display: inline;" v-if="activity.title1Show">结果核实</h3>
                    <el-tag :type="activity.tagType3" style="float: right;" v-if="activity.tagShow3" >{{ activity.complete3 }}</el-tag>
                    <p v-text="activity.responsibilityUnit1" style="margin-top: 90px;margin-bottom: 0px;" v-if="activity.responsibilityUnit1Show"></p>



                </el-card>
            </el-timeline-item>
        </el-timeline>
    </div>

<!--    审核意见-->
    <el-dialog title="请填写" :visible.sync="dialogFormVisible1">
        <el-form style="height: 268px; width: 100%;margin-bottom: 50px;">
            <el-form-item :label="dialogTitle" v-if="selectShow1">
                <el-input type="textarea" v-model="form.opinion"></el-input>
            </el-form-item>

            <el-form-item label="问题分类" :label-width="formLabelWidth" v-if="selectShow2" style="margin-left: 10%;" >
                <el-select v-model="form.classID" placeholder="请选择问题分类" :disabled="classFrom">
                    <el-option v-for="classification in classifications"
                               :key="classification.id"
                               :label="classification.className"
                               :value="classification.id"></el-option>
<!--                    <el-option label="区域二" value="beijing"></el-option>-->
                </el-select>
            </el-form-item>


            <el-cascader-panel :props="props" v-model="form.values" v-if="selectShow3"></el-cascader-panel>
        </el-form>

        <el-steps :active="active" finish-status="success" style="width: 50%;margin-left: 25%;">
            <el-step title="步骤 1"></el-step>
            <el-step title="步骤 2"></el-step>
            <el-step title="步骤 3"></el-step>
        </el-steps>

        <div slot="footer" class="dialog-footer">
            <el-button style="margin-top: 12px;" @click="pre" v-show="preStepShow">上一步</el-button>
            <el-button style="margin-top: 12px;" @click="next" v-show="nextStepShow" :disabled= nextStep>下一步</el-button>
            <el-button type="primary" @click="handOver" v-show="confirmButton" :disabled= determine>确 定</el-button>
        </div>
    </el-dialog>




<!--    <el-dialog title="收货地址" :visible.sync="dialogFormVisible2">-->
<!--&lt;!&ndash;        <el-form :model="form">&ndash;&gt;-->
<!--&lt;!&ndash;            <el-form-item label="活动名称" :label-width="formLabelWidth">&ndash;&gt;-->
<!--&lt;!&ndash;                <el-input v-model="form.name" autocomplete="off"></el-input>&ndash;&gt;-->
<!--&lt;!&ndash;            </el-form-item>&ndash;&gt;-->
<!--&lt;!&ndash;            <el-form-item label="活动区域" :label-width="formLabelWidth">&ndash;&gt;-->
<!--&lt;!&ndash;                <el-select v-model="form.region" placeholder="请选择活动区域">&ndash;&gt;-->
<!--&lt;!&ndash;                    <el-option label="区域一" value="shanghai"></el-option>&ndash;&gt;-->
<!--&lt;!&ndash;                    <el-option label="区域二" value="beijing"></el-option>&ndash;&gt;-->
<!--&lt;!&ndash;                </el-select>&ndash;&gt;-->
<!--&lt;!&ndash;            </el-form-item>&ndash;&gt;-->
<!--&lt;!&ndash;        </el-form>&ndash;&gt;-->
<!--        <div class="row mainContent" id="content-main">-->
<!--            <iframe class="RuoYi_iframe" name="iframe0" width="100%" height="100%" data-id="/system/main"-->
<!--                    th:src="@{/story/chatsearch/177}" frameborder="0" seamless></iframe>-->
<!--        </div>-->
<!--        <div slot="footer" class="dialog-footer">-->
<!--            <el-button @click="dialogFormVisible2 = false">取 消</el-button>-->
<!--            <el-button type="primary" @click="dialogFormVisible2 = false">确 定</el-button>-->
<!--        </div>-->
<!--    </el-dialog>-->

    <!-- Form -->
<!--    <el-button type="text" @click="dialogFormVisible = true">打开嵌套表单的 Dialog</el-button>-->

    <el-dialog title="答复" :visible.sync="dialogFormVisible2">
        <el-form>
            <el-form-item>
                <el-input type="textarea" v-model="form2.opinion"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible2 = false">取 消</el-button>
            <el-button type="primary" @click="submitOpinion()" :disabled= submitOpinionDisabled>确 定</el-button>
        </div>
    </el-dialog>




</div>


</body>
<script>
    var ctx = "\/";
    var prefix = ctx + "story-pc/story";

</script>
<!-- import JavaScript -->
<script src="../static/js/element-ui/index.js"  th:src="@{/js/element-ui/index.js}"></script>
<!--<script src="https://unpkg.com/element-ui/lib/index.js"></script>-->

<script src="https://cdn.jsdelivr.net/npm/vue-seamless-scroll@latest/dist/vue-seamless-scroll.min.js"></script>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    // var handleTime = "";
    // window.onload = function() {
    //     // alert("ssss");
    //     handleTime= [[ ${ handleTime } ]];
    //     // alert(handleState);
    //     console.log(handleTime);
    // }
    let id = [[ ${ id } ]];
    var manage = new Vue({
        el: '#app',
        data: function() {
            return {
                dialogTitle: "",
                titleShow: true,
                activities: [{
                    title: '问题未受理',
                    size: 'large',
                    type: 'primary',
                    color: '',
                    show: false,
                    buttonShow: true,
                    invalidButtonShow: true,
                    buttonContent: "受理",
                    time: "",
                    progress: "10%",
                    tagType: 'success',
                    complete: '已受理',
                    tagShow: false,
                    tooltipShow: true,
                    responsibilityUnit:"责任单位：事务服务中心",
                    counts: 1,

                    forShow: false,  //要么循环要么不循环
                    buttonContent1: "退回"
                }, {
                    title: '问题核实',
                    content: '',
                    replyPerson: '',
                    color: '',
                    show: false,
                    buttonShow: false,
                    buttonShow1: false,

                    lineShow: false,
                    buttonShow5: false,
                    buttonShow6: false,
                    forcedSubmitContent: '',
                    forcedSubmitTime: '',
                    forcedSubmitTagShow: false,
                    transferNumber: 1,

                    buttonContent: "完成审核",
                    time: "",
                    progress: "10%",
                    tagType: 'success',
                    complete: '已移交',
                    tagShow: false,
                    tooltipShow: false,

                    tagType1: 'success',
                    complete1: '已分类',
                    tagShow1: false,

                    tagType2: 'success',
                    complete2: '已核实',
                    tagShow2: false,

                    tooltipContent1: "",
                    tooltipContent2: "",

                    forcedSubmitOrder: 1,  //第一次强制提交

                    responsibilityUnit:"责任单位：事务服务中心",

                    counts: 1,
                    forShow: false,
                    buttonContent1: "退回"
                }, {
                    title: '部门沟通协调',
                    content: '答复',
                    transferNumber: 1,
                    forcedSubmitContent: '',
                    forcedSubmitTime: '',
                    forcedSubmitTagShow: false,
                    forcedSubmitOrder: 1,  //第一次强制提交
                    size: 'large',
                    color: '',
                    show: false,
                    buttonShow: true,
                    backButtonShow: true,
                    completeButtonShow: true,
                    completeNum: 1,
                    time: "",
                    progress: "10%",
                    tagType: 'success',
                    complete: '已反馈',
                    tagShow: false,
                    lineShow: false,
                    tooltipShow: true,

                    responsibilityUnit:"责任单位：处理部门",

                    title1: "结果核实",
                    title1Show: false,

                    tagType3: 'success',
                    complete3: '已完成/已退回',
                    tagShow3: false,

                    tagType4: 'success',
                    complete4: '已反馈',
                    tagShow4: true,

                    responsibilityUnit1:"责任单位：事务服务中心",
                    responsibilityUnit1Show: false,

                    counts: 3,  //该进度里面有一个子元素（比如有多个部门）
                    replys: [],
                    forShow: true,

                    otherShow: false,

                    completeDegree: 0,   //完成度
                    buttonContent1: "退回"
                }, {
                    // title: '二次沟通',
                    // replyPerson: '',
                    // color: '',
                    // show: false,
                    // buttonShow1: false,
                    // buttonShow: true,
                    // time: "",
                    // progress: "10%",
                    // tagType: 'success',
                    // complete: '二次核实',
                    // tagShow: false,
                    title: '二次沟通及协调结果',
                    content: '',
                    replyPerson: '',
                    color: '',
                    show: false,
                    buttonShow: false,
                    buttonShow1: false,
                    buttonContent: "完成审核",
                    time: "",
                    progress: "10%",
                    tagType: 'success',
                    complete: '已移交',
                    tagShow: false,
                    tooltipShow: false,

                    buttonShow5: false,
                    buttonShow6: false,
                    forcedSubmitContent: '',
                    forcedSubmitTime: '',
                    forcedSubmitTagShow: false,

                    forcedSubmitOrder: 2,  //第二次强制提交

                    forcedSubmitContent: '',
                    forcedSubmitTime: '',
                    forcedSubmitTagShow: false,
                    transferNumber: 2,

                    tagType1: 'success',
                    complete1: '已分类',
                    tagShow1: false,

                    tagType2: 'success',
                    complete2: '已核实',
                    tagShow2: false,

                    tooltipContent1: "",
                    tooltipContent2: "",

                    responsibilityUnit:"责任单位：事务服务中心",
                    buttonContent1: "退回"

                }, {
                    title: '部门二次沟通协调',
                    content: '答复',
                    transferNumber: 2,  //转交次数
                    size: 'large',
                    color: '',
                    show: false,
                    buttonShow: true,
                    backButtonShow: true,
                    completeButtonShow: true,
                    completeNum: 2,   //完成次数
                    time: "",
                    progress: "80%",
                    tagType: 'success',
                    complete: '已反馈',
                    tagShow: false,
                    lineShow: false,
                    tooltipShow: true,

                    responsibilityUnit:"责任单位：处理部门",

                    title1: "结果核实",
                    title1Show: false,

                    tagType3: 'success',
                    complete3: '已完成/已退回',
                    tagShow3: false,

                    tagType4: 'success',
                    complete4: '已反馈',
                    tagShow4: true,

                    responsibilityUnit1:"责任单位：事务服务中心",
                    responsibilityUnit1Show: false,

                    counts: 3,  //该进度里面有一个子元素（比如有多个部门）
                    replys: [],
                    forShow: true,

                    completeDegree: 0,

                    buttonContent1: "未完成"
                }, {
                    title: '未完成件转交',
                    content: '',
                    replyPerson: '',
                    color: '',
                    show: false,
                    buttonShow: false,
                    buttonShow1: false,
                    buttonShow2: false,
                    buttonContent: "移交校领导",
                    time: "",
                    progress: "80%",
                    tagType: 'success',
                    complete: '已移交',
                    tagShow: false,
                    tooltipShow: false,
                    buttonShow3: false,
                    buttonShow4: false,
                    // tagType1: 'success',
                    // complete1: '已分类',
                    // tagShow1: false,
                    //
                    // tagType2: 'success',
                    // complete2: '已核实',
                    // tagShow2: false,

                    tooltipContent1: "",
                    tooltipContent2: "",

                    transferNumber: 0,


                    responsibilityUnit:"责任单位：事务服务中心",


                }, {
                    title: '已完成（答复提交人）',
                    replyPerson: '',
                    color: '',
                    show: false,
                    buttonContent: "完成审核",


                    buttonShow3: false,
                    buttonShow4: false,

                    time: "",
                    progress: "10%",
                    responsibilityUnit:"责任单位：事务服务中心",

                }],
                departments: [],
                sysEmployee: [],
                handleState: 0,
                handleTime: [],
                id: 0,
                forcedSubmitOrder: 0,

                props: {
                    lazy: true,
                    multiple: true,
                    lazyLoad (node, resolve) {
                        const { level } = node;
                        setTimeout(() => {
                            const nodes = [];
                            if (level === 0){
                                for (let item of manage.departments){
                                    nodes.push({
                                        value: item.dept_id,
                                        label: item.dept_name,
                                        leaf: level >= 1
                                    })
                                }
                            }else if (level === 1){
                                $.ajax({
                                    type: "get",
                                    url: ctx + "story/admin/selectSysEmployeeByOrganizationCode/" + node.data.value,
                                    async: false,
                                    success: function (msg) {
                                        manage.sysEmployee = msg;
                                    },
                                    error: function (msg) {

                                    }
                                });
                                for (let item of manage.sysEmployee){
                                    nodes.push({
                                        value: item.key_ID,
                                        label: item.sys_NAME,
                                        leaf: level >= 1
                                    })
                                }
                            }
                            // 通过调用resolve将子节点数据返回，通知组件数据加载完成
                            resolve(nodes);
                        }, 1000);
                    }
                },


                dialogFormVisible1: false,
                dialogFormVisible2: false,
                form: {
                    classID: '',
                    values: [],
                    opinion: '',

                    departmentIDs: [],
                    sysEmployeeIDs: [],
                },
                form2: {
                    opinion: '',
                },
                storyClass: '',

                submitOpinionDisabled: true,

                formLabelWidth: '120px',

                //分类数组
                classifications:[],

                //
                // values:'s',
                //步骤
                active: 0,
                selectShow1: true,   //审核意见
                selectShow2: false,   //选择问题分类
                selectShow3: false,   //选择部门信息
                preStepShow: false,   //上一步
                nextStepShow: true,   //下一步
                confirmButton: false,
                opinions: false,

                nextStep: true,    //下一步是否可点
                determine: true,

                handleMsg: "",
                classFrom: false,


                isComplete: false,


            }
        },
        created() {
            this.showByHandleState();


            $.ajax({
                type: "get",
                url: ctx + "story/admin/selectMap",
                // async: false,
                success: function (msg) {
                    console.log(msg);
                },
                error: function (msg) {

                }
            });


        },
        mounted: function () {


        },
        methods:{
            showByHandleState(){
                this.handleState = [[${handleState}]]; //获得ModelMap的值
                this.id = [[${id}]];
                const time = [[${handleTime}]];
                this.forcedSubmitOrder = [[${forcedSubmitOrder}]];

                this.handleTime = [];
                // if (time != null)
                if (time.indexOf(',') != -1){
                    this.isComplete = true;
                    //如果不可以的话换成'[[${handleTime}]]'
                    this.handleTime = [[${handleTime}]].split(',');
                }
                else
                    this.handleTime[0] = [[${handleTime}]];


                //根据状态值来显示状态框
                if (this.handleState === -1){
                    this.titleShow = false;
                } else if (this.handleState === 0){
                    // this.activities[0].color = "#0bbd87";
                    this.activities[0].show = true;
                    this.activities[0].buttonShow = true;
                    this.activities[0].invalidButtonShow = true;
                    this.activities[0].progress = '0%';
                }else {
                    this.activities[0].invalidButtonShow = false;  //设置无效的按钮
                    if (this.handleState === 1){
                        this.activities[0].color = "#0bbd87";
                        this.activities[0].show = true;
                        this.activities[0].buttonShow = false;

                        // this.activities[1].color = "#0bbd87";
                        this.activities[1].show = true;
                        this.activities[1].buttonShow = false;
                        this.activities[0].tagShow = true;

                        this.activities[0].title = "问题受理";
                        this.activities[0].buttonShow = false;
                        this.activities[1].buttonShow1 = true;
                        this.activities[0].time = this.handleTime[0];
                        this.activities[0].progress = '10%';
                        // this.activities[1].progress = '20%  问题核实';
                        this.activities[1].title = "问题核实、分类、移交";
                        // this.activities[1].tagShow = true;
                        // this.activities[1].complete = "未核实";
                        // this.activities[1].tagType = "danger";
                        // this.activities[1].tooltipShow = true;
                    }
                    if (this.handleState >= 2){
                        this.activities[0].color = "#0bbd87";
                        this.activities[0].show = true;
                        this.activities[0].buttonShow = false;

                        this.activities[0].title = "问题受理";
                        this.activities[0].time = this.handleTime[0];
                        this.activities[0].tagShow = true;


                        this.activities[1].title = "问题核实、分类、移交";
                        this.activities[1].tagShow = true;
                        this.activities[1].tagShow1 = true;
                        this.activities[1].tagShow2 = true;
                        this.activities[1].color = "#0bbd87";
                        this.activities[1].show = true;
                        this.activities[1].buttonShow = false;

                        this.activities[1].lineShow = true;
                        this.activities[1].buttonShow5 = true;
                        this.activities[1].buttonShow6 = true;

                        this.activities[0].progress = '10%';
                        this.activities[1].progress = '30%';
                        //获取提交的部门人员
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectSysEmployeeNameAndOrganizationNameAndOpinion",
                            data: { storyId: this.id, transferNumber: 1},
                            // async: false,
                            success: function (msg) {
                                manage.activities[1].content = "核实结果：" + msg[0].opinion;
                                manage.form.opinion = msg[0].opinion;
                                manage.activities[1].time = msg[0].opinionTime;
                                msg.forEach(item =>{
                                    manage.activities[1].tooltipContent1 += item.departmentName + "的" + item.sysEmployeeName + "\n";
                                })
                            },
                            error: function (msg) {

                            }
                        });
                        //查出分类
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectClassById",
                            data: { storyId: this.id},
                            // async: false,
                            success: function (msg) {
                                manage.classifications = msg;
                                if(manage.classifications.length === 1){
                                    manage.activities[1].tooltipContent2 = manage.classifications[0].className;
                                    manage.storyClass = manage.classifications[0].className;
                                }

                                // location.reload();

                            },
                            error: function (msg) {
                            }
                        });

                        // this.activities[1].content = "问题已审核," + this.handleMsg;

                        //这个之后可能还会多个判断,因为有可能是直接完成的
                        // if(i == 1){
                        //     break;
                        // }
                    }
                    //移交人给出答复了
                    if (this.handleState >= 3 && this.forcedSubmitOrder != 1){
                        this.activities[1].lineShow = false;
                        this.activities[1].buttonShow5 = false;
                        this.activities[1].buttonShow6 = false;


                        this.activities[2].show = true;
                        this.activities[2].buttonShow = false;
                        // this.activities[2].progress = '70%';
                        this.activities[2].lineShow = true;
                        // this.activities[2].tagShow = true;
                        // this.activities[2].tooltipShow = false;
                        // this.activities[2].tagShow4 = true;
                        //获取答复信息
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectReply",
                            data: { storyId: this.id, transferNumber: 1 },
                            // async: false,
                            success: function (msg) {
                                manage.activities[2].replys = msg;
                                var count = 0;
                                msg.forEach(item =>{
                                    manage.activities[2].replys[count].lineShow1 = true;
                                    manage.activities[2].replys[count].responsibilityUnitShow = true;
                                    manage.activities[2].replys[count].departmentName = item.departmentName;
                                    if(item.isBack == -1) {
                                        //只要有一个未回复，就需要催办和强制提交
                                        if (manage.handleState == 3)
                                            manage.activities[2].otherShow = true;
                                    }else if (item.isBack == 0){
                                        manage.activities[2].replys[count].buttonShow = true;
                                        manage.activities[2].completeDegree++;
                                    }else if(item.isBack == 1){
                                        manage.activities[2].replys[count].buttonShow = false;
                                        manage.activities[2].replys[count].resultShow = true;
                                        manage.activities[2].replys[count].complete = "需二次处理";
                                        manage.activities[2].replys[count].tagType = "danger";
                                        manage.activities[2].completeDegree++;

                                    }else if(item.isBack == 2){
                                        manage.activities[2].replys[count].buttonShow = false;
                                        manage.activities[2].replys[count].resultShow = true;
                                        manage.activities[2].replys[count].complete = "已完结";
                                        manage.activities[2].replys[count].tagType = "success";
                                        manage.activities[2].completeDegree++;


                                    }
                                    manage.activities[2].replys[count].lineShow = true;
                                    if (count == msg.length-1){
                                        manage.activities[2].replys[count].lineShow = false;
                                    }
                                    if (item.reply === null){
                                        manage.activities[2].replys[count].buttonShow = false;
                                        manage.activities[2].replys[count].resultShow = false;
                                        manage.activities[2].replys[count].complete1 = "未反馈";
                                        manage.activities[2].replys[count].tagType1 = "danger";
                                        manage.activities[2].replys[count].responsibilityUnitShow = false; //不显示部门
                                        manage.activities[2].replys[count].lineShow1 = false;
                                    }else{
                                        manage.activities[2].replys[count].complete1 = "已反馈";
                                        manage.activities[2].replys[count].tagType1 = "success";
                                    }
                                    count = count + 1;
                                });

                                const completeDegree1 = (Math.round(parseFloat(manage.activities[2].completeDegree / count) * 40)) + 30;
                                console.log(completeDegree1);
                                manage.activities[2].progress = completeDegree1 + '%';

                            },
                            error: function (msg) {

                            }
                        });

                    }
                    //答复第一次被退回了
                    if (this.handleState >= 4 && this.handleState != 8 && this.forcedSubmitOrder != 1){
                        this.activities[2].color = "#0bbd87";
                        this.activities[3].show = true;
                        this.activities[3].buttonShow = false;

                        this.activities[3].lineShow = true;



                        this.activities[3].buttonShow1 = true;
                        this.activities[3].progress = '70%';
                        // if (this.handleState === 10){
                        //     this.activities[2].complete = "已退回";
                        //     this.activities[2].tagType1 = "danger";
                        // }
                    }
                    //
                    if (this.handleState >= 5  && this.handleState != 8 && this.forcedSubmitOrder != 1){

                        //获取提交的部门人员 和分类
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectSysEmployeeNameAndOrganizationNameAndOpinion",
                            data: { storyId: this.id, transferNumber: 2},
                            // async: false,
                            success: function (msg) {
                                manage.activities[3].content = "核实结果：" + msg[0].opinion;
                                manage.form.opinion = msg[0].opinion;
                                manage.activities[3].time = msg[0].opinionTime;
                                msg.forEach(item =>{
                                    manage.activities[3].tooltipContent1 += item.departmentName + "的" + item.sysEmployeeName + "\n";
                                    //查出分类
                                    manage.activities[3].tooltipContent2 = manage.storyClass;
                                })
                            },
                            error: function (msg) {

                            }
                        });

                        // this.activities[1].content = "问题已审核," + this.handleMsg;
                        this.activities[3].buttonShow1 = false;  //移交其他部门按钮
                        // this.activities[3].time = this.handleTime[2];
                        // this.activities[3].progress = '70%-80%';
                        // this.activities[3].color = "#0bbd87";
                        // this.activities[3].tagShow = true;
                        this.activities[3].buttonShow5 = true;
                        this.activities[3].buttonShow6 = true;

                        this.activities[3].tagShow = true;
                        // this.activities[3].tagShow1 = true;
                        this.activities[3].tagShow2 = true;
                        this.activities[3].color = "#0bbd87";
                        this.activities[3].show = true;
                        this.activities[3].buttonShow = false;

                        this.activities[3].progress = '70%';

                    }
                    if (this.handleState >= 6 && this.handleState != 8 && this.forcedSubmitOrder === 0){
                        this.activities[4].show = true;
                        this.activities[4].buttonShow = false;
                        this.activities[4].progress = '80%';
                        this.activities[4].lineShow = true;

                        this.activities[3].lineShow = false;
                        this.activities[3].buttonShow5 = false;
                        this.activities[3].buttonShow6 = false;

                        // this.activities[4].tagShow = true;
                        // this.activities[2].tooltipShow = false;
                        // this.activities[2].tagShow4 = true;
                        //获取答复信息
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectReply",
                            data: { storyId: this.id, transferNumber: 2 },
                            // async: false,
                            success: function (msg) {
                                manage.activities[4].replys = msg;
                                console.log(msg.length);
                                console.log(manage.activities[4].completeDegree);
                                var count = 0;
                                msg.forEach(item =>{
                                    manage.activities[4].replys[count].responsibilityUnitShow = true;
                                    manage.activities[4].replys[count].lineShow1 = true;
                                    if (item.isBack == -1){

                                    }else if (item.isBack == 0){
                                        manage.activities[4].replys[count].buttonShow = true;
                                        manage.activities[4].completeDegree++;
                                    }else if(item.isBack == 1){
                                        manage.activities[4].replys[count].buttonShow = false;
                                        manage.activities[4].replys[count].resultShow = true;
                                        manage.activities[4].replys[count].complete = "未完成";
                                        manage.activities[4].replys[count].tagType = "danger";
                                        manage.activities[4].completeDegree++;
                                    }else if(item.isBack == 2){
                                        manage.activities[4].replys[count].buttonShow = false;
                                        manage.activities[4].replys[count].resultShow = true;
                                        manage.activities[4].replys[count].complete = "已完结";
                                        manage.activities[4].replys[count].tagType = "success";
                                        manage.activities[4].completeDegree++;
                                    }
                                    manage.activities[4].replys[count].lineShow = true;
                                    if (count == msg.length-1){
                                        manage.activities[4].replys[count].lineShow = false;
                                    }
                                    if (item.reply === null){
                                        manage.activities[4].replys[count].buttonShow = false;
                                        manage.activities[4].replys[count].resultShow = false;
                                        manage.activities[4].replys[count].complete1 = "未反馈";
                                        manage.activities[4].replys[count].tagType1 = "danger";
                                        manage.activities[4].replys[count].responsibilityUnitShow = false; //不显示部门
                                        manage.activities[4].replys[count].lineShow1 = false;
                                    }else{
                                        manage.activities[4].replys[count].complete1 = "已反馈";
                                        manage.activities[4].replys[count].tagType1 = "success";
                                    }
                                    count = count + 1;
                                });
                                console.log(manage.activities[4].completeDegree);
                                console.log(count);
                                const completeDegree2 = (Math.round(parseFloat(manage.activities[4].completeDegree / count) * 10)) + 70;
                                console.log(completeDegree2);
                                manage.activities[4].progress = completeDegree2 + '%';
                            },
                            error: function (msg) {

                            }
                        });
                    }
                    if (this.handleState >= 7 && this.handleState != 8 && this.handleState != 9){
                        this.activities[4].color = "#0bbd87";
                        this.activities[5].show = true;
                        this.activities[5].buttonShow2 = true;
                        console.log("this.forcedSubmitOrder=" + this.forcedSubmitOrder)
                        if (this.forcedSubmitOrder === 1){
                            this.activities[1].buttonShow5 = false;
                            this.activities[1].buttonShow6 = false;
                            this.activities[1].forcedSubmitTagShow = true;
                            this.activities[1].forcedSubmitContent = "移交的部门未答复，已强制提交";
                            // this.activities[1].forcedSubmitTime = "2020-10-09 09:50:18";

                            $.ajax({
                                type: "get",
                                url: ctx + "story/admin/selectForcedSubmitTime",
                                data: { storyId: this.id},
                                // async: false,
                                success: function (msg) {
                                    manage.activities[1].forcedSubmitTime = msg;

                                },
                                error: function (msg) {

                                }
                            });
                        }else if (this.forcedSubmitOrder === 2){
                            this.activities[3].buttonShow5 = false;
                            this.activities[3].buttonShow6 = false;
                            this.activities[3].forcedSubmitTagShow = true;
                            this.activities[3].forcedSubmitContent = "移交的部门未答复，已强制提交";
                            // this.activities[1].forcedSubmitTime = "2020-10-09 09:50:18";

                            $.ajax({
                                type: "get",
                                url: ctx + "story/admin/selectForcedSubmitTime",
                                data: { storyId: this.id},
                                // async: false,
                                success: function (msg) {
                                    manage.activities[3].forcedSubmitTime = msg;

                                },
                                error: function (msg) {

                                }
                            });
                        }


                    }
                    if (this.handleState >= 8){
                        // 第一次点完结
                        this.activities[5].show = true;
                        this.activities[5].title = "结果答复";
                        this.activities[5].progress = '90%';
                        this.activities[2].color = "#0bbd87";
                        this.activities[5].buttonShow2 = false;
                        this.activities[5].buttonShow3 = true;
                        this.activities[5].buttonShow4 = true;
                        // this.activities[4].buttonShow2 = false;
                    }
                    //第二次直接直接点完结
                    if (this.handleState >= 9){
                        this.activities[4].color = "#0bbd87";
                        this.activities[5].tagShow = true;
                        this.activities[5].color = "#0bbd87";
                        this.activities[5].show = true;
                        this.activities[5].buttonShow = false;
                        this.activities[5].complete = "已完成";
                        this.activities[5].progress = '90%';
                        this.activities[5].tooltipShow = false;


                        this.activities[5].buttonShow3 = true;
                        this.activities[5].buttonShow4 = true;
                        if (this.handleState == 9){
                            this.activities[5].tagShow = false;
                        }
                    }
                    // 已移交校领导
                    if (this.handleState >= 10){
                        this.activities[5].tagShow = true;
                        this.activities[5].complete = "已移交校领导";
                        this.activities[5].tagType = "success";

                        this.activities[5].tagShow = true;
                        this.activities[5].color = "#0bbd87";
                        this.activities[5].show = true;
                        this.activities[5].buttonShow = false;


                        this.activities[5].progress = '90%';
                        this.activities[5].buttonShow2 = false;
                        this.activities[5].buttonShow3 = false;
                        this.activities[5].buttonShow4 = false;

                        if (this.forcedSubmitOrder === 1){
                            this.activities[5].transferNumber = 2;
                        }else {
                            this.activities[5].transferNumber = 3;
                        }

                        //获取提交的部门人员 和分类
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectSysEmployeeNameAndOrganizationNameAndOpinion",
                            data: { storyId: this.id, transferNumber: this.activities[5].transferNumber},
                            // async: false,
                            success: function (msg) {
                                console.log(msg);
                                manage.activities[5].content = "未完成件汇报情况：" + msg[0].opinion;
                                manage.form.opinion = msg[0].opinion;
                                // if (manage.handleState === 10 && manage.isComplete){
                                //     console.log(msg[0].opinionTime);
                                manage.activities[5].time = msg[0].opinionTime;
                                // }else {
                                //     manage.activities[5].time = "";
                                // }

                                msg.forEach(item =>{
                                    manage.activities[5].tooltipContent1 += item.departmentName + "的" + item.sysEmployeeName + "\n";
                                    //查出分类
                                    manage.activities[5].tooltipContent2 = manage.storyClass;
                                })
                            },
                            error: function (msg) {

                            }
                        });
                        this.activities[4].color = "#0bbd87";

                        this.activities[6].title = "结果答复";
                        this.activities[6].progress = '90%';
                        this.activities[6].show = true;
                        this.activities[6].buttonShow3 = true;
                        this.activities[6].buttonShow4 = true;

                    }
                    if (this.isComplete){
                        if (this.handleState == 8 || this.handleState == 9){
                            this.activities[5].show = false;
                        }
                        this.activities[6].show = true;
                        this.activities[6].progress = '100%';
                        this.activities[6].color = "#0bbd87";
                        this.activities[6].time = this.handleTime[1];
                        this.activities[6].content = "答复：";
                        this.activities[6].title = "已完成（答复提交人）";

                        this.activities[6].tagShow = true;
                        this.activities[6].complete = "已完成";
                        this.activities[6].tagType = "success";

                        var opinionTime = "";
                        //获取提交的部门人员
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/selectStoryOpinion",
                            data: { storyId: this.id},
                            async: false,
                            success: function (msg) {
                                // console.log(msg.opinion);
                                // console.log(manage.activities[6].content);

                                opinionTime = "答复：" + msg.opinion;
                            },
                            error: function (msg) {

                            }
                        });

                        this.activities[6].content = opinionTime;
                        this.activities[6].buttonShow3 = false;
                        this.activities[6].buttonShow4 = false;




                        this.activities[5].color = "#0bbd87";
                        this.activities[5].buttonShow2 = false;
                        this.activities[5].buttonShow3 = false;
                        this.activities[5].buttonShow4 = false;
                    }
                }
            },
            // open() {
            //     if (this.handleState === 0){
            //         this.confirmAccess("受理");
            //     }
            //     if (this.handleState === 1){
            //         this.confirmAudit("审核");
            //     }
            // },
            invalid() {
                this.$confirm('是否设置为无效件？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/invalidHandleState",
                        data: { id: this.id },
                        success: function (msg) {
                            manage.showByHandleState();
                            // --------
                            manage.$message({
                                type: 'success',
                                message: '已设置为无效状态！'
                            });
                            location.reload();

                        },
                        error: function (msg) {
                            manage.$message({
                                type: 'info',
                                message: '已取消'
                            });
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },
            //确认受理
            confirmAccess(){
                this.$confirm("是否确认受理?", "提示", {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/updateHandleState",
                        data: { handleState: this.handleState, id: this.id},
                        success: function (msg) {
                            // --------
                            manage.$message({
                                type: 'success',
                                message: '已受理！'
                            });
                            location.reload();
                        },
                        error: function (msg) {
                            manage.$message({
                                type: 'info',
                                message: '已取消受理'
                            });
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消受理'
                    });
                });
            },

            //确认审核（是否移交到其他部门，或直接完成）
            confirmAudit(type){
                this.$confirm('是否确认'+  type+"?", '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.$message({
                        type: 'success',
                        message: '已' + type + '！'
                    });

                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消' + type
                    });
                });
            },
            //移交其他部门
            handOver(){
                this.$confirm('是否确定提交?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    if (this.handleState === 7){ //
                        console.log("移交校领导+++++++++++++++")
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/updateHandleStateByCompletion",
                            data: { handleState: this.handleState, id: this.id},
                            async: false,
                            success: function (msg) {
                                location.reload();
                            },
                            error: function (msg) {
                            }
                        });
                    }else {
                        console.log("移交其他领导+++++++++++++++")
                        $.ajax({
                            type: "get",
                            url: ctx + "story/admin/updateHandleState",
                            data: { handleState: this.handleState, id: this.id},
                            async: false,
                            success: function (msg) {
                                location.reload();
                            },
                            error: function (msg) {
                            }
                        });
                    }



                    $.ajax({
                        type: "post",
                        url: ctx + "story/admin/insertStoryAndSysEmployee",
                        data: {
                            storyID: manage.id,
                            classID: manage.form.classID,
                            departmentID: manage.form.departmentIDs,
                            sysEmployeeID: manage.form.sysEmployeeIDs,
                            values: manage.form.values,
                            opinion: manage.form.opinion,
                        },
                        dataType: "text",
                        contentType: "application/x-www-form-urlencoded; charset=utf-8",
                        // async: false,
                        success: function (msg) {

                            location.reload();
                        },
                        error: function (msg) {
                        }
                    });
                    location.reload();
                    manage.dialogFormVisible1 = false;

                    this.$message({
                        type: 'success',
                        message: '提交成功！'
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消提交'
                    });
                });
            },
            // 退回  （）
            backToThe(replyId, transferNumber){
                // this.dialogFormVisible2 = true;
                console.log(replyId);
                console.log(transferNumber);
                this.$confirm('是否退回？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/updateReplyStateByCompletion",
                        data: { handleState: this.handleState, storyId: this.id, replyId: replyId, isBack: 1, transferNumber: transferNumber},
                        async: false,
                        success: function (msg) {
                            location.reload();
                        },
                        error: function (msg) {
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },
            //完结
            complete(replyId, transferNumber){
                // this.dialogFormVisible1 = true;
                this.$confirm('是否完结？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/updateReplyStateByCompletion",
                        data: { handleState: this.handleState, storyId: this.id, replyId: replyId, isBack: 2, transferNumber: transferNumber},
                        async: false,
                        success: function (msg) {
                            location.reload();
                        },
                        error: function (msg) {
                        }
                    });

                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });

            },
            //得到分类和部门信息,审核意见
            showAngLoading(){
                this.dialogFormVisible1 = true;
                this.dialogTitle = "审核意见";
                // $.ajax({
                //     type: "get",
                //     url: ctx + "story/admin/selectOpinion",
                //     data: { storyId: this.id},
                //     success: function (msg) {
                //         manage.form.opinion = msg;
                //     },
                //     error: function (msg) {
                //     }
                // });

                //先查出看有没有分类
                $.ajax({
                    type: "get",
                    url: ctx + "story/admin/selectClassById",
                    data: { storyId: this.id},
                    success: function (msg) {
                        manage.classifications = msg;
                        if(manage.classifications.length === 1){
                            manage.form.classID = manage.classifications[0].id;
                            manage.classFrom = true;
                        }
                    },
                    error: function (msg) {
                    }
                });

                //得到部门信息
                $.ajax({
                    type: "get",
                    url: ctx + "story/admin/selectDepartmentInfoList",
                    success: function (msg) {
                        manage.departments = msg;
                    },
                    error: function (msg) {
                    }
                });
            },
            //得到校领导信息
            showAngLoading2(){
                this.dialogFormVisible1 = true;
                this.dialogTitle = "未完成件转交校领导批示";
                // $.ajax({
                //     type: "get",
                //     url: ctx + "story/admin/selectOpinion",
                //     data: { storyId: this.id},
                //     success: function (msg) {
                //         manage.form.opinion = msg;
                //     },
                //     error: function (msg) {
                //     }
                // });

                $.ajax({
                    type: "get",
                    url: ctx + "story/admin/selectClassById",
                    data: { storyId: this.id},
                    success: function (msg) {
                        manage.classifications = msg;
                        if(manage.classifications.length === 1){
                            manage.form.classID = manage.classifications[0].id;
                            manage.classFrom = true;
                        }
                    },
                    error: function (msg) {
                    }
                });


                //得到部门信息（校领导信息       ）
                $.ajax({
                    type: "get",
                    url: ctx + "story/admin/selectDepartmentInfoList",
                    success: function (msg) {
                        manage.departments = msg;

                    },
                    error: function (msg) {
                    }
                });
            },
            toChat(){
                var url = prefix + '/chatsearch/' + id;
                // var ss = problem;
                //第一个参数是标签的名称
                $.modal.openTab("聊天管理", url);
            },
            theEnd(){
                this.dialogFormVisible2 = true;
            },
            submitOpinion(){
                this.$confirm('是否完成？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/updateOpinion",
                        data: { handleState: this.handleState, id: this.id, opinion: manage.form2.opinion},
                        success: function (msg) {
                            this.dialogFormVisible2 = false;
                            location.reload();
                        },
                        error: function (msg) {
                            manage.$message({
                                type: 'info',
                                message: '已取消'
                            });
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },
            cuiBan(transfer){
                console.log(transfer + "次移交");
                $.ajax({
                    type: "get",
                    url: ctx + "story/admin/cuiBan",
                    data: { storyId: id, transferNumber: transfer },
                    success: function (msg) {
                        manage.$message({
                            type: 'success',
                            message: '催办成功'
                        });
                    },
                    error: function (msg) {
                        manage.$message({
                            type: 'info',
                            message: '催办失败'
                        });
                    }
                });
            },
            forcedSubmit(forcedSubmitOrder){
                this.$confirm('确定强制提交？', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    $.ajax({
                        type: "get",
                        url: ctx + "story/admin/forcedSubmit",
                        data: { storyId: id, forcedSubmitOrder: forcedSubmitOrder },
                        success: function (msg) {
                            manage.$message({
                                type: 'success',
                                message: '强制提交成功'
                            });
                            location.reload();
                        },
                        error: function (msg) {
                            manage.$message({
                                type: 'info',
                                message: '催办失败'
                            });
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消'
                    });
                });
            },

            //上一步骤
            pre() {
                if (this.active === 2){
                    this.active--;

                    this.selectShow1 = false;
                    this.selectShow2 = true;
                    this.selectShow3 = false;

                    this.preStepShow = true;
                    this.nextStepShow = true;
                    this.confirmButton = false;
                    this.form.values = [];
                }else if (this.active === 1){
                    this.active--;
                    this.preStepShow = false;
                    this.nextStepShow = true;

                    this.selectShow1 = true;
                    this.selectShow2 = false;
                    this.selectShow3 = false;

                    this.nextStep = false;
                }
            },
            //下一步骤
            next() {
                if (this.active == 0){
                    this.active++;
                    this.selectShow1 = false;
                    this.selectShow2 = true;
                    this.selectShow3 = false;
                    if (this.form.classID.length != 0){
                        this.nextStep = false;
                    }else {
                        this.nextStep = true;
                    }

                    this.preStepShow = true;
                    this.nextStepShow = true;
                }else if (this.active == 1){
                    this.selectShow1 = false;
                    this.selectShow2 = false;
                    this.selectShow3 = true;
                    this.active++;
                    this.preStepShow = true;
                    this.nextStepShow = false;

                    this.confirmButton = true;
                    this.determine = true;
                }
            }
        },
        computed: {
            classID(){
                return this.form.classID;
            },
            values(){
                return this.form.values;
            },
            opinion(){
                return this.form.opinion;
            },
            storyOpinion(){
                return this.form2.opinion;
            }

        },
        watch: {
            classID(){
                this.nextStep = false;
            },
            values(){
                //values是一个二维数组
                // for (var i=0; i<this.form.values.length; i++){
                //     this.form.departmentIDs[i] = this.form.values[i][0];
                //     this.form.sysEmployeeIDs[i] = this.form.values[i][1];
                // }
                this.form.departmentIDs = [];
                this.form.sysEmployeeIDs = [];
                this.form.values.forEach(item =>{
                    this.form.departmentIDs.push(item[0]);
                    this.form.sysEmployeeIDs.push(item[1]);
                });


                if (this.form.values.length != 0){
                    this.determine = false;
                }else {
                    this.determine = true;
                }

            },
            opinion() {
                if (this.form.opinion.length === 0){
                    this.nextStep = true;
                }else {
                    this.nextStep = false;
                }
            },
            storyOpinion(){
                if (this.form2.opinion.length === 0){
                    this.submitOpinionDisabled = true;
                }else {
                    this.submitOpinionDisabled = false;
                }
            }
        }
    })
</script>

</html>
